const routerContext = require.context('./modules', true, /\.js$/) // 获取路由模块的上下文
let moudelRoutes = []
routerContext.keys().forEach(route => {
    const routerModule =  routerContext(route) // 得到路由的模块
    // 兼容 import export 和 require module.export 两种规范
    moudelRoutes = [ ...moudelRoutes,...(routerModule.default || routerModule)]

 });
export const docIndexChildren = moudelRoutes